import React, { PureComponent } from 'react'
import Cart from './pages/Cart'

export class App extends PureComponent {
  constructor() {
    super()
    this.state = {
      isLogin: false
    }
  }
  goLogin() {
    localStorage.setItem('token', 'logined')
    this.setState({
      isLogin: true
    })
    // this.forceUpdate()
  }
  render() {
    return (
      <div>
        <h1>App</h1>
        <button onClick={() => this.goLogin()}>登录</button>
        <Cart />
      </div>
    )
  }
}

export default App